﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Sealight.Core.DataAdapter;
using Sealight.CoreAPI;
using Sealight.API.Ioc;
namespace Sealight.UI.WebUI.Services
{
    public class NewsService
    {
        public static IList<news> Gets()
        {
            var svc = IocContainer.Container().Resolve<INewsService>();

            return svc.GetAllNews();
        }

        public static news GetById(Guid id)
        {
            var svc = IocContainer.Container().Resolve<INewsService>();
            return svc.GetById(id);           
        }
        public static news AddUpdate(news data)
        {
            var svc = IocContainer.Container().Resolve<INewsService>();
            return svc.AddOrUpdate(data);
        }
        public static void Delete(Guid id)
        {
            var svc = IocContainer.Container().Resolve<INewsService>();
            svc.Delete(new news { id = id });
        }
        public static IList<news_source> GetAllSource()
        {
            var svc = IocContainer.Container().Resolve<INewsService>();
            return svc.GetAllSource();
        }
    }
}